<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
    'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name' => 'Đánh Lô Đề Chơi Lô Đề online',
    // preloading 'log' component
    'preload' => array('log'),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.components.constant.*',
        'application.components.custom_validator.*',
        'application.components.liberty_api.*',
        'application.components.game.*',
        'application.components.mail.*',
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool

        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'lemontree89',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array('*', '::1'),
        ),
    ),
    // application components
    'components' => array(
        'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
        ),
        // use Smarty to render page using file template .tpl :D
        /*'viewRenderer' => array(
            'class' => 'application.extensions.yiiext.renderers.smarty.ESmartyViewRenderer',
            'fileExtension' => '.tpl',
            'config' => array("left_delimiter" => "{%", "right_delimiter" => "%}")
        //'pluginsDir' => 'application.smartyPlugins',
        //'configDir' => 'application.smartyConfig',
        ),*/
        // URL Format
        'urlManager' => array(
            'urlFormat' => 'path',
        		'showScriptName'=>false,
            'rules' => array(
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),
        // Database configs
        'db' => array(
            'connectionString' => 'mysql:host=vietlode.db.9170001.hostedresource.com;dbname=vietlode',
            'emulatePrepare' => true,
            'username' => 'vietlode',
            'password' => 'Abc123!',
            'charset' => 'UTF8',
        ),
        // Error handle
        'errorHandler' => array(
            // use 'media/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'components' => array(
           'session' => array(
              'class' => 'CDbHttpSession',
              'timeout' => 60*60*100, // 6 hours
               'autoStart'=>true,
           ),
        ),
        // Log configs
        /*'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'trace, info, error, warning',
                ),
                // uncomment the following to show log messages on web pages
                /
                array(
                    'class' => 'CWebLogRoute',
                ),
            ),
        ),*/
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'webmaster@example.com',
    ),
);